<!doctype html>
<html>
<head>
<?php $this->load->view('admin/common_head'); ?>
</head>
<body>
<div class="wrap">
	<div class="nav">
		<ul class="cc">
			<li class="current"><a href="<?php echo site_url('admin/user_manage/index'); ?>">用户管理</a></li>
			<li><a href="<?php echo site_url('admin/user_manage/add'); ?>">添加用户</a></li>
		</ul>
	</div>
	<!--
	<div class="h_a">提示信息</div>
	<div class="mb10 prompt_text">
		<ol>
			<li>用户名和电子邮箱支持模糊搜索。用户名或电子邮箱输入"a" 则检索出所有以a开头的用户名或电子邮箱。</li>
			<li>可以对用户的基本信息、积分信息、用户组，以及用户产生的内容进行管理。</li>
		</ol>
	</div>
	<div class="mb10"><a class="btn" href="<?php echo site_url('admin/user_manage/add'); ?>" title="添加用户"><span class="add"></span>添加用户</a></div>
	-->
	<div class="h_a">搜索</div>
	<div class="search_type cc mb10">
		<form action="<?php echo site_url('admin/user_manage/index'); ?>" method="get">
			<label>用户组：</label>
			<select name="groupid" class="mr10">
				<option value="-1" <?php echo set_select('groupid', -1, $get['groupid'] == -1); ?>>不限制</option>
				<!--
				<option value="0">普通组</option>
				<option value="1">会员</option>
				<option value="2">游客</option>
				<option value="3">管理员</option>
				<option value="4">总版主</option>
				<option value="5">论坛版主</option>
				<option value="6">禁止发言</option>
				<option value="7">未验证会员</option>
				<option value="16">VIP</option>
				-->
			</select>
			<label>用户名：</label>
			<input name="username" type="text" class="input length_2 mr10" value="<?php echo $get['username']; ?>" />
			<label>UID：</label>
			<input name="uid" type="number" class="input length_1 mr10" value="<?php echo $get['uid']; ?>" />
			<label>邮箱：</label>
			<input name="email" type="text" class="input mr10" value="<?php echo $get['email']; ?>" />
			<label>模糊：</label>
			<input name="like" type="checkbox" class="mr10" value="both" <?php echo set_checkbox('like', 'both', $get['like'] == 'both'); ?> />
			<button type="submit" class="btn mr10">搜索</button>
			<span class="gray">勾选模糊查询后速度比较慢</span>
		</form>
	</div>
	<div class="table_list">
		<table width="100%">
			<colgroup>
				<col width="80" />
				<col width="80" />
				<col width="200" />
				<col width="150" />
				<col width="60" />
			</colgroup>
			<thead>
				<tr>
					<td>UID</td>
					<td>用户名</td>
					<td>电子邮箱</td>
					<td>注册时间</td>
					<td>状态</td>
					<td>操作</td>
				</tr>
			</thead>
			<tbody>
			<?php
				foreach($users as $user) {
					$user['status'] == 'active' && $status = '<span class="green">激活</span>';
					$user['status'] == 'unactive' && $status = '<span class="gray">待激</span>';
					$user['status'] == 'lock' && $status = '<span class="red">锁定</span>';
			?>
				<tr>
					<td><?php echo $user['uid']; ?></td>
					<td><?php echo $user['username']; ?></td>
					<td><?php echo $user['email']; ?></td>
					<td><?php echo date('Y-m-d H:i:s', $user['created']); ?></td>
					<td><?php echo $status; ?></td>
					<td>
						<a href="<?php echo site_url('admin/user_manage/edit_base?uid='.$user['uid']); ?>" class="mr10" title="编辑">[编辑]</a>
					<?php if($user['status'] == 'active') { ?>
						<a class="J_ajax_del" data-msg="确定要锁定吗？" href="<?php echo site_url('admin/user_manage/change_status?status=lock&uid='.$user['uid']); ?>" title="锁定">[锁定]</a>
					<?php } elseif ($user['status'] == 'lock') { ?>
						<a class="J_ajax_del" data-msg="确定要解锁吗？" href="<?php echo site_url('admin/user_manage/change_status?status=unlock&uid='.$user['uid']); ?>" title="解锁">[解锁]</a>
					<?php } elseif ($user['status'] == 'unactive') { ?>
						<a class="J_ajax_del" data-msg="确定要激活吗？" href="<?php echo site_url('admin/user_manage/change_status?status=active&uid='.$user['uid']); ?>" title="激活">[激活]</a>
					<?php } ?>
					</td>
				</tr>
			<?php } ?>
			</tbody>
		</table>
		<div data-key="true" class="J_page_wrap mb20">
			<?php echo $this->pagination->create_links(); ?>
		</div>
	</div>
</div>
<?php $this->load->view('admin/common_footer'); ?>
</body>
</html>